// import { rejects } from "assert"
// import { resolve } from "path/posix"

var url = 'https://www.gzzyue.com'

export const request = (option)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
				url: url+option.url, //获取个人信息。
				method: option.method,
				header: {
					'Authorization': option.url=='/prod-api/login' || option.url=='/prod-api/register' ? '' : uni.getStorageSync("token") //自定义请求头信息
				},
				data:option.data,
				success: (res) => {
				resolve(res)
				},
				fail: (errors) => {
				reject(res)
				},
			});
		})
}